package hydrap2p.gui.commands;

import hydrap2p.gui.GUIDataHandler;
import hydrap2p.gui.MockModule;
import hydrap2p.gui.StartupManagerPanel;

import javax.swing.JOptionPane;

public class Cmd_StartupManagerPanel_ShowModuleProperties implements Command {

	@Override
	public void execute() {
		int index = StartupManagerPanel.getInstance().getTable().getSelectedRow();
		
		MockModule module = GUIDataHandler.getInstance().getModules().get(index);
		
		String message = "Name: " + module.getName() + "\n";
		message += "Active: " + module.getStatus() + "\n";
		message += "Autostart: " + module.getAutostart() + "\n";
		
		JOptionPane.showMessageDialog(null, message, "Properties", JOptionPane.INFORMATION_MESSAGE);
		
		System.out.println(getCommand());
	}

	@Override
	public String getCommand() {
		return this.getClass().getSimpleName();
	}

	@Override
	public void unexecute() {
		// TODO Auto-generated method stub

	}

}
